package Day03;

public class Text2 {
    public static int sum = 0;
    public static void main(String[] args) {
        //求n的阶乘
        System.out.println(add(4));
        System.out.println(sum);

    }

    public static int add(int n){
        if(n == 1){
            return n;
        }
        int temp = n * add(n -1);
        sum += temp;
        return temp;
    }
}
